import { constantRoutes } from '@/router'

export default {
  namespaced: true, // 开启命名空间
  state: {
    routes: constantRoutes
  },
  mutations: {
    // 声明合并动态和静态路由的方法
    setRoutes(state, asyncRoutes) {
      state.routes = [...constantRoutes, ...asyncRoutes]// 合并
    }
  }
}
